Using event handlers for processing notifications is a standard way with many advantages. There also situations, however, where event handlers are not very practical. For example, if you want to do fundamentally different processing on different kinds of subscriptions, you end up with all notifications being processed by the same event handler, and you need to put in extra code to distinguish between different kinds of subscriptions they come from. Event handlers also require additional code to set up and tear down.
In order to overcome these problems, OPC Data Client components allow you to pass in a delegate for a callback method to subscription methods. There are subscription methods overloads that accept the callback method parameter. The callback method has the same signature (arguments) as the event handler, and is called by the component in addition to invoking the event handler (if you do not hook a handler to the event, only the callback method will be invoked). You can therefore pass in the delegate for the callback method right into the subscription method call, without setting up event handlers.
The callback method can also be specified using an anonymous delegate or a lambda expression, i.e. without having to declare the method explicitly elsewhere in your code. This is especially useful for short callback methods.
For subscription methods that work with multiple subscriptions at once, there is also a Callback (in OPC Classic) or DataChangeCallback (in OPC-UA) property in the arguments objects that you can use for the same purpose.
Note that if you specify a non-null callback parameter to the subscription method, the callback method will be invoked in addition to the event handlers. If you use both event handlers and callback methods in the same application, and you do not want the event handlers to process the notifications that are also processed by the callback methods, you can either